Mapping oil spills in California from 2000-2010.
This report visualizes data on oil spills in California recorded in 2008 in the Oil Spill Prevention and Response (OSPR) Incident Tracking database. An oil spill incident in this dataset is defined as “a discharge or threatened discharge of petroleum or other deleterious material into the waters of the state.”
Citation: Oil Spill Incident Tracking [ds394], 2009-07-23. 2008 Edition.
# Read in data
oil_raw_sf <- read_sf(here('_posts', '2022-03-09-oil-spill-map', 'data', 'ds394', 'ds394.shp'))
oil_sf <- oil_raw_sf %>%
janitor::clean_names()
counties_sf <- read_sf(here('_posts', '2022-03-09-oil-spill-map', 'data', 'counties', 'CA_Counties_TIGER2016.shp'))
counties_subset_sf <- counties_sf %>%
janitor::clean_names() %>%
select(county_name = name, land_area = aland)
# Set coordinate system Projections are different. To align them, we take the CA county projection and apply it to the oil spill data.
oil_4326_sf <- st_transform(oil_sf, st_crs(counties_subset_sf))
# Plot with tmap
tmap_mode(mode = 'view')
tm_shape(counties_subset_sf) +
tm_borders() +
tm_fill('land_area',
title = "Land Area (meters squared)",
palette = 'BuGn') +
tm_borders(col = 'black') +
tm_shape(oil_4326_sf) +
tm_dots(col = 'darkslateblue')